package com.credithc.customers.dataservice.mapper.XT;

import com.credithc.baseserv.core.mapper.BsBaseMapper;
import com.credithc.customers.dataservice.po.EntrustUserPO;
import com.credithc.customers.dataservice.po.GdAccountPo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface EntrustUserMapper extends BsBaseMapper<EntrustUserPO> {
    @Select("SELECT max(id) from entrust_user_auths;")
    Long queryProductMaxId();
    @Select("SELECT  entrust_user_auths.bank_acc_no accountNo ,entrust_user_auths.bind_state bind_state , entrust_user.system_sign subSystemSign ,entrust_user_auths.create_at accountCreateTime,\n" +
            "entrust_user_auths.update_at accountUpdateTime ,entrust_user.customer_no customerNo, entrust_user.id userSourceId\n" +
            "from  entrust_user_auths\n" +
            "LEFT JOIN entrust_user on entrust_user.id_card = entrust_user_auths.id_no  where entrust_user_auths.id< #{toString} and entrust_user_auths.id >= #{toString}-1000  ORDER BY entrust_user_auths.id desc;")
    List<GdAccountPo> queryDlrProduct(String toString);
}
